package edu.hncj.seckill.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000117637787";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCbhYj+DqOrvIfN9pwWS341vh317vrjwItqTe+xKzUZ7YSrVG2swaLU8Bms/KmUAhQtVELudVN8/tyOOVdNwmXuTGrP29oDCceRX+g2yOPXEXohZ6jiIrKoC1QXt3WW++SOm2yWB0qPAlltf/AIA3aToZ9KhJylWX9nUB/W61lnXxmR8QedIDS1Sk5LDDyrPb5xHiIsYdjCYOca9vDrBqYE37QIq0GT9ZS7gnqG8xmj5LA+qomuu9/II9dwI9fE3jaG3u5QT/NpazZs7gIngXaLoGw8Fp/aCgvSCDUPNooNmrCBw7ZZ+Ej3PKWtUg+CIbLx7VdH0/zQDfOi5mxcgBnTAgMBAAECggEAZSmZkNjo8h8yn3EY2w/ESyUdzAnlvRxUE5QapD4czn7H28KRjNxwFN8RdIrtq88mXM4As6gx5I7L3N/DwFsBft7KY+b4ix1jaVbfcDOAsTc3IF+TZXV4jQLBcqPto4a6h2DmYzje8ONwVF/yPOQzz5hES26zjoMG8qcV7vEsOKaFrULoAZaepkcIu46jQ9hd+6X0j5SsRWmItSutg0ZAtOX0HMzQtdvOHWW/uQzxouuAh7eH7xCW0n2O5AfEnkuZHPYNhJSMMrr6Tf1QixekbbTmyDwCQFa8s0rEVChDqiz37/5sSxLGSzxEzehtygB1qhrofRAQKBgQDwClwnrQOn5HwurP+c7DXrbUFk12GZf4wblAjcAvfjA54bbNyCqQcqmYN7tM58Zw7J2BtmASEwTBSQ6XSftn3JJ2I6xfkf9fhn+soigZWQZSJ60G72tZrmIyJj3V3MO/mudu4DldiiCrC/9/smPPcuJNCY1C7XKV2qtpUrlcXAwQKBgQCl3JxyFqxDno5OfXgWYZq/YMxqklqynqOo+yzzm6940n7/s2DXnm85tkOp5zFv5kUz9LmWACotv8vGkdA8BvyH3zpM9a/Tcp4S0udxqmpUtgleQM+M1aSvpuWXatlE1b/2EbNuGB/NrzPtbiGmKGv8xAuUiq1VSSIgFpDUVxIrkwKBgBF4j5CLtTJpHOjAyrH/N0V1ZEcUrhPgBrCTK7nntWcegkl4uOwBpXXiSoGcfVLspVTnl8bq2iGLyAtsEoL1Y15asXmZozJCUtwukrvENsCVu9a4iPsH6MhLUlt2ZzdQPjIGkfhM1cGliYvPXsY/tbX0FAKrnuUmK50bQOw1MHmBAoGAMxeOKabKUdoZxBvqThqq7KEI1xtWTQeJKpiU9EXU+8b70BCVmFX5tTFsDn5lQC8SyjpsoMRUOduHDhgEqTkNuV0OPH7CNsRr5SiKmvz/3DBnGl2kkaGOJX2n48jKPOYLR+WT/Cn6QgXiXRU70E9LVIWfe5ZsZoUsue25l29q7XkCgYEA2LHT897oG+k13+Ze5v2DLelVitsy/Q++7y9sK1M/ntSitvoeZyEKGBodgQIo5r466wTbhbNE86tfGrS+usTAlT9VXVbBiHokfsnYT6o4jgos2a0hSOGBakyAEuyrQzkXiOmfx/tuvEDfXBuSemePgDVnXGgLX3sKCL3KE8VRSDQ=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjAw0BAQEFAAOCAQ8AMIIBCgKCAQEAnUySlUX6Lvlf72BzH0RYEDKEATV4+wop7j3J21a/l0GbYhpq/p9jT6XsSAXoRWQGz4rg7P6fmRabIrIyywEOq3n7fQu+6KLPXmYtf/wFfRz4ngdT3cQH7KyXDq2dWnL7Ih22eyf3mcoDwS3yFakmunJG/FzmMJo0Ex2btH/H+G+YMDF6kHJ5/Dr17LtvcC/wJL2keNCSLnprnAA/tlBTpj0ofYn4rOj5XSVCX02Wtkb2tgqTmh5d1cDUApdcEgNUPlK5IX9hs3CtBdyVc/zzYneDVQqYt8S5QvXZEmiQhHk7ReLAKhCjFGOpvGy+rEntWELFUU3seYfceyH/g1OXewIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://xxx.xxx.xxx.xxx:80/alipay/notify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://xxx.xxx.xxx.xxx:80/alipay/returnurl";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

